﻿using System;

namespace Microsoft.OpenApi;

/// <summary>
/// Defines the base properties for the security scheme object.
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
/// </summary>
public interface IOpenApiSecurityScheme : IOpenApiDescribedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiSecurityScheme>, IOpenApiReferenceable
{
    /// <summary>
    /// REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "oauth2", "openIdConnect".
    /// </summary>
    public SecuritySchemeType? Type { get; }

    /// <summary>
    /// REQUIRED. The name of the header, query or cookie parameter to be used.
    /// </summary>
    public string? Name { get; }

    /// <summary>
    /// REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie".
    /// </summary>
    public ParameterLocation? In { get; }

    /// <summary>
    /// REQUIRED. The name of the HTTP Authorization scheme to be used
    /// in the Authorization header as defined in RFC7235.
    /// </summary>
    public string? Scheme { get; }

    /// <summary>
    /// A hint to the client to identify how the bearer token is formatted.
    /// Bearer tokens are usually generated by an authorization server,
    /// so this information is primarily for documentation purposes.
    /// </summary>
    public string? BearerFormat { get; }

    /// <summary>
    /// REQUIRED. An object containing configuration information for the flow types supported.
    /// </summary>
    public OpenApiOAuthFlows? Flows { get; }

    /// <summary>
    /// REQUIRED. OpenId Connect URL to discover OAuth2 configuration values.
    /// </summary>
    public Uri? OpenIdConnectUrl { get; }

    /// <summary>
    /// Specifies that a security scheme is deprecated and SHOULD be transitioned out of usage.
    /// Note: This field is supported in OpenAPI 3.2.0+. For earlier versions, it will be serialized as x-oai-deprecated extension.
    /// </summary>
    public bool Deprecated { get; }
}
